package com.lagou.config;

import org.apache.catalina.startup.Tomcat;

/**
 * description MyTomcat
 * author wy
 * date 2021-06-06 14:21
 **/
public class MyTomcat
{
    public void createServer()
    {
        Tomcat tomcat = new Tomcat();
        tomcat.setPort(8081);
        try
        {
            tomcat.addWebapp("/","D://apache-tomcat-8.5.65//webapps");
            tomcat.start();

            tomcat.getServer().await();
        }
        catch ( Exception e)
        {
            e.printStackTrace();
        }
    }
}
